Oracle Data Provider for .NET (ODP.NET) Demonstration Programs

Contents
--------
(1) REF Cursor and PL/SQL Demo - Retrieve multiple REF Cursors using PL/SQL; Shows connection pooling parameters
(2) LOB Demo - Retrieve CLOB and BLOB and update the CLOB
(3) XML Query and Save Demo - Retrieve data as XML and save XML changes
(4) XMLType and XML View Demo - Retrieve data from XML View and save XML changes; Using XML View and XMLType improves XML performance


Demo Requirements
-----------------
Visual Studio .NET (VS.NET) 
ODP.NET (includes the Oracle9i Release 2 or Oracle 10g client)
Local or remote access to an Oracle Database (Oracle8, 8i, 9i, or 10g) with the SCOTT schema (scott/tiger)

If you do not have the SCOTT schema, run the "scott.sql" script from SQL*Plus to build the schema.  Each demo may have a specific set of setup scripts.  Those scripts can be found within each demo's directory.

Demo (4) requires Oracle9i Release 2 or higer database server.


Running Demo 1 (REF Cursor)
--------------------------
The demo can be run without any changes if you have a single local database (data source value is blank).  If you need to use a data source alias, modify line 39 of the "RefCursor.cs" file.  Add the alias to the "Data Source" variable.

string constr = "User Id=scott;Password=tiger;Data Source=<DB alias>";

The demo supports SQL updates, but only for the Dept column.  To update, modify the Dept column value of one of the employees to either 10, 20, or 30.  Click on the Update button and requery the DB for the updated results.

"RefCursor.cs" contains all the ODP.NET code.  "RCForm.cs" does not contain any ODP.NET code.  It provides the application logic for the GUI portion of the application.


Running Demo 2 (LOB)
--------------------
You will need to run "proddb.sql" first followed by "images.sql" from SQL*Plus while logged in as SCOTT.  You will need to make three modifications to "images.sql".
* On line 2, change the SYSTEM user password to the proper password.  Add data source alias if necessary.
* On line 5, change 'c:\LOB\images\' to the directory where you've copied the images for the demo
* On line 9, change the SCOTT login to the same user who ran "proddb.sql". Add data source alias if necessary.

This demo supports performing updates only on the Product Description box, demonstrating two different ways to perform this CLOB update.

"LOB.cs" contains all the ODP.NET code.  "LOBForm.cs" does not contain any ODP.NET code.  It provides the application logic for the GUI portion of the application.


Running Demo 3 (XML Query and Save)
-----------------------------------
The demo can be run without any changes if you have a single local database (data source value is blank).

The demo show how to retrieve relational data as XML with ODP.NET and then to insert/update/delete XML back to the database.  The ODP.NET XML APIs are contained within the "ManageEmp.cs" file.


Running Demo 4 (XMLType and XML View)
-------------------------------------
This demo requires Oracle9i Release 2 or higer database server.

You will need to run "createview.sql" from SQL*Plus while logged in as SCOTT to create the XML view and instead-of triggers.  The demo can then be run without any changes if you have a single local database (data source value is blank).

By creating an XML view, relational data has been pre-processed as XML so as to improve run-time XML retrieval and update performance.  The demo shows how to use the ODP.NET XMLType data type, which makes XML easier to use and perform faster.


Additional Resources
--------------------
More information on ODP.NET can be found at:
http://otn.oracle.com/tech/windows/odpnet/

More ODP.NET samples can be found at:
http://otn.oracle.com/sample_code/tech/windows/odpnet/
And as part of your ODP.NET installation: <Oracle Home>\odp.net\samples\
